//
//  RegisterThirdViewController.m
//  Snigger
//
//  Created by Young on 16/8/19.
//  Copyright © 2016年 Smile. All rights reserved.
//

#import "RegisterThirdViewController.h"

#import "RegisterNickNamePortraitVC.h"

#define kBackgroundColor [UIColor colorWithRed:236 / 256.0 green:237 / 256.0 blue:240 / 256.0 alpha:1.0]

@interface RegisterThirdViewController ()

@property (weak, nonatomic) IBOutlet UILabel *noticeLabel;
@property (weak, nonatomic) IBOutlet UITextField *setPasswordTextField;
@property (weak, nonatomic) IBOutlet UITextField *verifyingPasswordTextField;
@property (weak, nonatomic) IBOutlet UIButton *nextbutton;
@property (weak, nonatomic) IBOutlet UILabel *setPasswordLabel;
@property (weak, nonatomic) IBOutlet UILabel *confirmPasswordLabel;
@property (weak, nonatomic) IBOutlet UIView *upLine;
@property (weak, nonatomic) IBOutlet UIView *downLine;

@end

@implementation RegisterThirdViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"Set password";
    self.view.backgroundColor = kBackgroundColor;
    _nextbutton.layer.cornerRadius = 5;
}

- (IBAction)nextClicked:(id)sender {
    RegisterNickNamePortraitVC *nickNamePortraitVC = [[RegisterNickNamePortraitVC alloc] init];
    nickNamePortraitVC.passwordString = _setPasswordTextField.text;
    [self.navigationController pushViewController:nickNamePortraitVC animated:YES];
}

- (IBAction)tapSetPasswordLabelAction:(id)sender {
    [UIView animateWithDuration:0.75 animations:^{
        _setPasswordLabel.frame = CGRectMake(0, _setPasswordTextField.frame.origin.y, 100, _setPasswordTextField.bounds.size.height);
        _setPasswordLabel.textColor = [UIColor blackColor];
        _setPasswordTextField.frame = CGRectMake(100, _setPasswordTextField.frame.origin.y, self.view.bounds.size.width - 100, _setPasswordTextField.bounds.size.height);
        _upLine.hidden = NO;
        _setPasswordLabel.userInteractionEnabled = NO;
    }];
}

- (IBAction)tapConfirmPasswordLabelAction:(id)sender {
    [UIView animateWithDuration:0.75 animations:^{
        _confirmPasswordLabel.frame = CGRectMake(0, _verifyingPasswordTextField.frame.origin.y, 100, _setPasswordTextField.bounds.size.height);
        _confirmPasswordLabel.textColor = [UIColor blackColor];
        _verifyingPasswordTextField.frame = CGRectMake(100, _verifyingPasswordTextField.frame.origin.y, self.view.bounds.size.width - 100, _setPasswordTextField.bounds.size.height);
        _downLine.hidden = NO;
        _confirmPasswordLabel.userInteractionEnabled = NO;
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
